package java_zhuoer_adv3;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class GetMax {

	public static void main(String[] args) {

		try {
			// 这样有问题
			// DataInputStream din = new DataInputStream(new
			// FileInputStream(""));
			// din.readInt();
			int max = Integer.MIN_VALUE;
			Scanner sc = new Scanner(new FileInputStream(
					"C:\\Users\\Administrator\\Desktop\\data1.txt"));
			while (sc.hasNextInt()) {
				int i = sc.nextInt();
				if (max < i)
					max = i;
			}
			sc.close();
			System.out.println("The max is :" + max);

		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}
}
